package com.matrix.java.chap_04;

import java.util.Scanner;

/*
    检测子串
 */
public class Ex4_22 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.print("Enter string s1: ");
        String s1 = input.next();
        System.out.print("Enter string s2: ");
        String s2 = input.next();
        if (s1.contains(s2)) {
            System.out.println(s2 + "is a substring of" + s1);
        } else {
            System.out.println(s2 + "is not a substring of" + s1);
        }
        input.close();
    }
}
